package com.example.myapp;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {
   /* TextView textView;
    Button button;
    private final String TAG = "MainActivity";*/
   private Button btnStartGame,btnGameInfo,btnExit;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initViews();
        initEvents();
  /*      textView = (TextView) findViewById(R.id.textView);
        button = (Button) findViewById(R.id.button);
        button.setOnClickListener(new L1());
        Log.i(TAG, "onCreate: ");*/
} /*class L1 implements View.OnClickListener {

        @Override
        public void onClick(View view) {
            textView.setText("牛皮");
        }
    }*/

    private void initEvents() {
        btnStartGame.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MainActivity.this,LevelActivity.class);
                startActivity(intent);
            }
        });
        btnGameInfo.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MainActivity.this,GameInfoActivity.class);
                startActivity(intent);
            }
        });
        btnExit.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View view) {
                System.exit(0);

            }
        });
    }

    private void initViews(){
        btnStartGame = findViewById(R.id.btn_start_game);
        btnGameInfo = findViewById(R.id.btn_game_info);
        btnExit = findViewById(R.id.btn_exit);

    }
}
